<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<table class="display" style="clear: none">
	<thead>
		<tr>
			<th>姓名</th>
			<th>部门</th>
			<th>岗位</th>
			<th>职等</th>
			<th>原始分数</th>
			<th>特别审批</th>
		</tr>
	</thead>
	<tbody>
		<s:if
			test="#request.examQualScores == null || #request.examQualScores.size() <= 0">
			<tr class="gradeX">
				<td colspan="6">暂无数据</td>
			</tr>
		</s:if>
		<s:else>
			<s:iterator value="#request.examQualScores" var="qualscore"
				status="sta">
				<s:if test="#sta.even">
					<tr class="gradeX">
				</s:if>
				<s:else>
					<tr class="gradeC">
				</s:else>
				<td>${qualscore.name}</td>
				<td>${qualscore.fullName}</td>
				<td>${qualscore.dutyName}</td>
				<td>${qualscore.gradeName}-${qualscore.gradeSort}</td>
				<td><span name="ctl_score" title="${qualscore.workId}"><s:if test="#qualscore.id == null">
						<a class="button"
							href="#exam/qual_score_detail.xhtml?op=au&type=${type}&periodDesc=${periodDesc}&workId=${qualscore.workId}"><span
							style="background: url(${ctx}/images/img/chart_curve_add.png)"
							class="icon">&nbsp;</span>打分</a>
					</s:if> <s:elseif test="#request.allowGenerateScore == false">
						<a class="button"
							href="javascript:void(0)"><span
							style="background: url(${ctx}/images/img/chart_curve_edit.png)"
							class="icon">&nbsp;</span>${qualscore.rawScore}分</a>
					</s:elseif><s:else>
						<a class="button"
							href="#exam/qual_score_detail.xhtml?op=au&type=${type}&periodDesc=${periodDesc}&workId=${qualscore.workId}"><span
							style="background: url(${ctx}/images/img/chart_curve_edit.png)"
							class="icon">&nbsp;</span>${qualscore.rawScore}分</a>
					</s:else></span></td>
				<td><span><s:if
						test="#qualscore.id == null or #qualscore.adjustScore == null">
						<a class="button"
							href="#exam/qual_score_dist_detail.xhtml?op=ad&type=${type}&periodDesc=${periodDesc}&workId=${qualscore.workId}"><span
							style="background: url(${ctx}/images/img/chart_curve_add.png)"
							class="icon">&nbsp;</span>打分</a>
					</s:if><%-- <s:elseif test="#request.examPeriod.endSpecialScoring > 0">
						<a class="button"
							href="javascript:void(0)"><span
							style="background: url(${ctx}/images/img/chart_curve_edit.png)"
							class="icon">&nbsp;</span>${qualscore.adjustScore}分</a>
					</s:elseif> --%> <s:else>
						<a class="button"
							href="#exam/qual_score_dist_detail.xhtml?op=fr&type=${type}&periodDesc=${periodDesc}&workId=${qualscore.workId}"><span
							style="background: url(${ctx}/images/img/chart_curve_edit.png)"
							class="icon">&nbsp;</span>${qualscore.adjustScore}分</a>
					</s:else></span></td>
				</tr>
			</s:iterator>
		</s:else>

	</tbody>
</table>
<p><%@ include file="/WEB-INF/pages/exam/exam_score_pager.jsp"%></p>

<script type="text/javascript">
	$(document).ready(function(){
		$("span[name='ctl_score']").each(function(i) {
			checkShowScore(this, $(this).attr("title"));
		});
	});
	
	function checkShowScore(obj,workId){
		$.ajax({
			type : "get",
			url : "/ajax/check_showscore.xhtml?workId=" + workId,
			//data: "name=John&location=Boston",
			dataType : "html",
			success : function(res) {
				if (res != null) {
					if(res == "false"){
						$(obj).attr("style","display:none");
						$(obj).parent().next().find("span").attr("style","display:none");
					}
				}
			}
		});
	}
</script>